package com.vicular;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;

public class ScanQRActivity extends Activity {
	
	private long m_dwSplashTime=5000;
    private boolean m_bPaused=false;
    private boolean m_bSplashActive=true;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		Window window = getWindow();
	    window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
	    Thread splashTimer=new Thread()
        {
            public void run(){
                try{
                    //wait loop
                    long ms=0;
                    while(m_bSplashActive && ms<m_dwSplashTime){
                        sleep(10);

                        if(!m_bPaused)
                            ms+=100;
                    }

//                    startActivity(new Intent("com.google.app.splashy.CLEARSPLASH"));
                    startActivity(new Intent("com.vicular.READY"));
                }
                catch(Exception ex){
                    Log.e("Splash",ex.getMessage());
                }
                finally{
                    finish();
                }
            }
        };
        splashTimer.start();

	}

}